/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * Title: Route</p>
 * <p>
 * Description: CS 343 Project. Stores the data model for the route properties.
 * List is an ordered set of Vertices</p>
 *
 * @date 11/18/2013
 *
 * @author Dylan Ahmann - Class Programming
 * @author Gregg Roemhildt - Class Programming and Javadocs
 * @author Sam Brockmann - Javadocs
 * @author Emily Hancock - Javadocs
 * @author Shirin Asadi
 *
 * @param <E> type of data stored in Vertex
 *
 */
public class Route<E extends Serializable> {

    protected List<Vertex<E>> path;

    /**
     * default constructor
     *
     * Initializes path to a new array list.
     */
    public Route() {
        this.path = new ArrayList<>();
    }

    /**
     * alternate constructor - copies a list of vertexes
     *
     * @param l list of vertexes
     */
    public Route(List<Vertex> l) {
        this.path = new ArrayList<>();
        for (Vertex v : l) {
            path.add(v);
        }
    }

    /**
     * toString - toString method for Route class
     *
     * @return String
     */
    @Override
    public String toString() {
        String text = "";
        for (Vertex e : path) {
            text += e + "\n";
        }
        return text;
    }
}
